<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Fan extends Model
{
    //两者二选一即可
    // protected $guarded = [];//不可以注入的字段
    protected $fillable = ['start_id','fan_id'];//可以注入的字段

    //粉丝用户
    public function fuser(){
    	return $this->hasOne(\App\User::class,'id','fan_id');
    }

    //明星用户 被关注的用户
    public function suser(){
    	return $this->hasOne(\App\User::class,'id','star_id');
    }
}
